﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Templates/Template2.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>


<asp:Content ID="Content2" ContentPlaceHolderID="menuContent" runat="server">
    <%
    //string[] menuArray = { "0", "0", "0", "0", "0", "0","1"};
      string[] menuArray = { "0", "0", "0", "0", "1"};
      Session["menuArray"] = menuArray;
%>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="body" runat="server">
    <script type="text/javascript">


        $(document).ready(function () {

            $(".datepicker").datepicker();
            // validar formulario
            //            $("#clienteForm").validate();
            $("#clienteForm").validate({
                submitHandler: function (form) {
                    submitForm("");
                    alert("submit");
                },
                rules: {
                    NumeroDocumento: "required",
                    Email: {
                        required: true,
                        email: true
                    },
                    Direccion: "required",
                    Telefono: "required",
                    FecNacimiento: "required",
                    Usuario: "required",
                    Contrasena: "required"

                }
            });

        });

        function submitForm() {

            var $form = $("#clienteForm");

            $.ajax({
                type: "POST",
                url: $form.attr('action'),
                data: $form.serialize(),
                error: function (xhr, status, error) {
                    $.msgBox({
                        content: error,
                        type: "error"
                    });
                },
                success: function (data) {
                    $("#loading-div-background").hide();
                    if (data.tipoMensaje == 'INFO') {
                        $.msgBox({
                            content: data.mensaje,
                            type: "info",
                            afterClose: function () {
                                window.location = data.redirectTo;
                            }
                        });
                    } else if (data.tipoMensaje == 'WARN') {
                        $.msgBox({
                            content: data.mensaje,
                            type: "alert"
                        });
                    }

                },
                beforeSend: function (data) {
                    $("#loading-div-background").show();
                }
            });

            return false;
        }
    </script>

    <h2 style="font-size: large">&nbsp;</h2>
        <table>
            <tr>
                <td class="style3" style="width: 57px">IdPedido</td>
                <td style="width: 338px"></td>
            </tr>
            <tr>
                <td class="style3" style="width: 57px">Producto</td>
                <td style="width: 338px"></td>
            </tr>
            <tr>
                <td class="style3" style="width: 57px">Cantidad</td>
                <td style="width: 338px"></td>
            </tr>
            <tr>
                <td class="style3" style="width: 57px">Monto</td>
                <td style="width: 338px"></td>
            </tr>
            <tr>
                <td style="width: 338px" colspan="2"><input type="button" id="Button1"  value="Regresar"/></td>
            </tr>
        </table>
  
        
      
     

</asp:Content>
